/*
 * @Author: jiangyg email@jiangyg.com
 * @Date: 2022-11-14 07:05:38
 * @LastEditors: jiangyg email@jiangyg.com
 * @LastEditTime: 2022-11-14 21:18:11
 * @FilePath: /frontend/mall-frontend/src/components/data-table/search-item.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
    defineComponent,
    getCurrentInstance,
} from "vue";

import {
    ElFormItem,
} from "element-plus";

export default defineComponent({
    name: "DtSearchItem",

    props: {
        label: { type: String, required: true },
        prop: { type: String, required: false, default() {return ""} }
    },

    components: {
        ElFormItem,
    },

    /**
     * 组件渲染
     * @returns 
     */
    render() {
        // 获取当前实例
        let instance = getCurrentInstance();
        return (
            <el-form-item label={instance.props.label} prop={instance.props.prop}>
                { instance.slots.default() }
            </el-form-item>
        )
    },
});